import request from "@/utils/request";

// 获取验证码
function verifyCaptcha(query) {
    return request({
        url: "/verifyCaptcha",
        method: "get",
        params: query,
    });
}
// 微信下单
function wxUnifiedOrder(data) {
    return request({
        url: "/api/pay/wx_unified_order",
        method: 'post',
        data: data
    });
};
// 根据订单code查询支付状态
function checkPayStatus(data) {
    return request({
        url: "/api/pay/checkPayStatus",
        method: 'get',
        params: data
    });
};

// 获取会员类型
function queryAllVipType(data) {
    return request({
        url: "/api/index/queryAllVipType",
        method: 'get',
        params: data
    });
};
// 聊天
function workflowsRun(data) {
    return request({
        url: "/api/agent/chat-messages",
        method: 'post',
        data: data
    });
};

// 文字类生成
function workflowsRunDetail(data) {
    return request({
        url: "/api/agent/workflows/run",
        method: 'post',
        data: data
    });
};

// 搜索智能体
function querySearchAgentList(data) {
    return request({
        url: "/api/index/querySearchAgentList",
        method: 'get',
        params: data
    });
};
//  查询所有智能体数据
function queryAllAgent(data) {
    return request({
        url: "/api/index/queryAllAgent",
        method: 'get',
        params: data
    });
};
// 首页热度搜索
function hotAgent(data) {
    return request({
        url: "/api/index/hotAgent",
        method: 'get',
        params: data
    });
};
// 根据智能体类型查询列表
function selectAgentByType(data) {
    return request({
        url: "/api/index/selectAgentByType",
        method: 'get',
        params: data
    });
};


// 智能体详情
function queryAppInfoByCode(data) {
    return request({
        url: "/api/index/queryAppInfoByCode",
        method: 'get',
        params: data
    });
};

// 查询历史聊天列表
function conversations(data) {
    return request({
        url: "/api/agent/conversations",
        method: 'get',
        params: data
    });
};

// 根据会话ID查询历史记录
function getMessagesItem(id) {
    return request({
        url: "/api/agent/getMessages/" + id,
        method: 'get',
    });
};
// 根据会话ID删除历史记录
function deleteMessages(id) {
    return request({
        url: "/api/agent/deleteMessages/" + id,
        method: 'get',
    });
};
// 停止请求流式生成
function stopMessages(id) {
    return request({
        url: "/api/agent/stopMessages/" + id,
        method: 'get',
    });
};

// 获取免费次数
function agentSupport(id) {
    return request({
        url: "/api/agent/support",
        method: 'get',
    });
};

// 认证是否可以使用
function agentCheckSupport(data) {
    return request({
        url: "/api/agent/checkSupport",
        method: 'POST',
        data: data
    });
};
export default {
    verifyCaptcha,
    workflowsRun,
    wxUnifiedOrder,
    queryAllVipType,
    querySearchAgentList,
    hotAgent,
    queryAllAgent,
    selectAgentByType,
    queryAppInfoByCode,
    checkPayStatus,
    conversations,
    getMessagesItem,
    deleteMessages,
    stopMessages,
    agentSupport,
    workflowsRunDetail,
    agentCheckSupport
}